home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 117
/
FreelogNo117-OctobreNovembre2013.iso
/
Programmation
/
jedit
/
jedit5.1.0install.exe
/
{app}
/
macros
/
Emacs
/
Emacs_Kill_Region.bsh
< prev
next >
Wrap
Text File
|
2013-07-28
|
758b
|
28 lines
/**
* Emulate GNU Emacs's "kill-region" capability (normally bound to Ctrl-W),
* which kills the text between the caret and the mark, copying it to the kill
* ring. This version is slightly different: If there's any selected text, it
* kills and copies that text. Otherwise, it selects the text between the
* caret and the mark, and kills and copies that.
*
* Does NOT use jEdit markers.
*/
source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
void emacsKillRegion()
{
selection = getKillRegion();
if (selection == null)
beep();
else
{
addToClipboardAndHistory (selection);
textArea.replaceSelection ("");
textArea.removeFromSelection (selection);
}
}
emacsKillRegion();